/*
 * @Description: 提现
 * @Author: iamsmiling
 * @Date: 2021-06-10 22:30:01
 * @LastEditTime: 2021-06-15 09:32:47
 */
import 'package:credit_business_circle/R/R.dart';
import 'package:credit_business_circle/pages/mine/children/partner/children/kpi/children/withdrawal/withdrawal_controller.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

class WithdrawalPage extends GetView<WithdrawalController> {
  const WithdrawalPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("申请提现"),
        elevation: .5,
      ),
      backgroundColor: R.color.ffffffff,
      body: GetBuilder<WithdrawalController>(builder: (_) {
        return SingleChildScrollView(
          child: Container(
            child: Column(
              children: [
                Container(
                  padding:
                      EdgeInsets.only(top: R.dimen.dp27, right: R.dimen.dp24),
                  color: R.color.ffffffff,
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Container(
                        margin: EdgeInsets.only(
                            left: R.dimen.dp22, bottom: R.dimen.dp20),
                        child: Text(
                          "结算金额",
                          style: TextStyle(
                              fontSize: R.dimen.sp17,
                              color: R.color.ff333333,
                              fontWeight: FontWeight.w600),
                        ),
                      ),
                      Container(
                        margin: EdgeInsets.only(
                          left: R.dimen.dp20,
                        ),
                        child: Row(
                          children: [
                            Expanded(
                                child: TextFormField(
                              style: TextStyle(
                                  fontSize: R.dimen.sp26,
                                  fontWeight: FontWeight.w600),
                              decoration: InputDecoration(
                                hintText: "在此输入金额，申请的金额不得低于50星币",
                                prefixIcon: Container(
                                  alignment: Alignment.center,
                                  child: Text(
                                    "￥",
                                    style: TextStyle(
                                        fontSize: R.dimen.sp26,
                                        fontWeight: FontWeight.w600),
                                  ),
                                ),
                                prefixIconConstraints: BoxConstraints(
                                    minWidth: R.dimen.dp30,
                                    maxWidth: R.dimen.dp30,
                                    maxHeight: R.dimen.dp48,
                                    minHeight: R.dimen.dp48),
                                border: UnderlineInputBorder(
                                    borderSide: BorderSide(
                                        color: R.color.ffcccccc, width: .5)),
                                focusedBorder: UnderlineInputBorder(
                                    borderSide: BorderSide(
                                        color: R.color.ffcccccc, width: .5)),
                                enabledBorder: UnderlineInputBorder(
                                    borderSide: BorderSide(
                                        color: R.color.ffcccccc, width: .5)),
                              ),
                            )),
                            Container(
                              margin: EdgeInsets.only(left: R.dimen.dp10),
                              child: Text(
                                "星币",
                                style: TextStyle(
                                    fontSize: R.dimen.sp18,
                                    fontWeight: FontWeight.w600),
                              ),
                            ),
                          ],
                        ),
                      ),
                      Container(
                        margin: EdgeInsets.symmetric(
                            vertical: R.dimen.dp22, horizontal: R.dimen.dp20),
                        child: Text.rich(TextSpan(
                            text: "账户可结算星币：",
                            style: TextStyle(
                                fontSize: R.dimen.sp14,
                                color: R.color.ff555555),
                            children: [
                              TextSpan(
                                  text: "665星币",
                                  style: TextStyle(color: R.color.fffe6601))
                            ])),
                      )
                    ],
                  ),
                ),
                Divider(
                  height: R.dimen.dp10,
                  color: R.color.fff5f5f5,
                  thickness: R.dimen.dp10,
                ),
                Container(
                  color: R.color.ffffffff,
                  padding: EdgeInsets.only(
                      top: R.dimen.dp20,
                      left: R.dimen.dp22,
                      right: R.dimen.dp22),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      DefaultTextStyle(
                          style: TextStyle(
                              fontSize: R.dimen.sp15, color: R.color.ff333333),
                          child: Container(
                            child: Row(
                              children: [
                                Container(
                                    margin:
                                        EdgeInsets.only(right: R.dimen.dp24),
                                    child: Text("到账账户:")),
                                for (ReceiveAccountType item
                                    in ReceiveAccountType.values)
                                  Row(
                                    children: [
                                      Checkbox(
                                        value: _.type == item,
                                        materialTapTargetSize:
                                            MaterialTapTargetSize.shrinkWrap,
                                        tristate: true,
                                        side: BorderSide(
                                          color: R.color.ffcccccc,
                                        ),
                                        shape: RoundedRectangleBorder(
                                            borderRadius: BorderRadius.circular(
                                                R.dimen.sp9)),
                                        onChanged: (bool? flag) {
                                          // _.selectReason(flag, item);
                                        },
                                        activeColor: R.color.ff00c28a,
                                      ),
                                      Container(
                                        child: Text("${item.name}"),
                                      )
                                    ],
                                  )
                              ],
                            ),
                          )),
                      Container(
                        margin: EdgeInsets.only(bottom: R.dimen.dp28),
                        padding: EdgeInsets.symmetric(vertical: R.dimen.dp20),
                        child: Row(
                          children: [
                            Container(
                                margin: EdgeInsets.only(right: R.dimen.dp16),
                                child: Image.asset(R.image.wechat)),
                            Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Text(
                                  "陈*朵",
                                  style: TextStyle(
                                      fontSize: R.dimen.sp16,
                                      color: R.color.ff222222,
                                      fontWeight: FontWeight.w600),
                                ),
                                Container(
                                  child: Text(
                                    "支付宝账号：1369595959",
                                    style: TextStyle(
                                        fontSize: R.dimen.sp15,
                                        color: R.color.ff777777),
                                  ),
                                )
                              ],
                            ),
                            Spacer(),
                            Image.asset(
                              R.image.next,
                              color: R.color.ff888888,
                              scale: 1,
                            )
                          ],
                        ),
                      ),
                      ElevatedButton(
                          onPressed: () {},
                          style: ButtonStyle(
                              shape: MaterialStateProperty.all(
                                  RoundedRectangleBorder(
                                      borderRadius:
                                          BorderRadius.circular(R.dimen.sp5))),
                              backgroundColor:
                                  MaterialStateProperty.all(R.color.ff1bbf8e)),
                          child: Text("申请提现")),
                      Container(
                        margin: EdgeInsets.only(top: R.dimen.dp40),
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Text(
                              "合伙人星币提现说明：",
                              style: TextStyle(
                                  height: 2,
                                  fontSize: R.dimen.sp13,
                                  color: R.color.ff222222,
                                  fontWeight: FontWeight.w600),
                            ),
                            Text(
                              """1、星币兑换比例：1星币=1元;
2、申请提现的金额不可低于50星币;
3、为了您的资金安全，财务信息姓名必须和平台实名认 证姓名保持一致；
4、每月1-7日财务会陆续处理申请的提现请求；
5、合伙人发起的提现由平台代缴6%个人所得税；""",
                              style: TextStyle(
                                  height: 1.5,
                                  fontSize: R.dimen.sp13,
                                  color: R.color.ff555555),
                            )
                          ],
                        ),
                      )
                    ],
                  ),
                ),
              ],
            ),
          ),
        );
      }),
    );
  }
}
